package com.aloda.ojquestion.pojo.dto;

import com.aloda.ojcommon.domain.entity.QuestionSubmit;
import lombok.Data;

/**
 * @Author aloda
 * @Date 2025/4/27 16:02
 */
@Data
public class QuestionSubmitDTO {

    /**
     * 编程语言
     */
    private String language;

    /**
     * 用户代码
     */
    private String code;

    /**
     * 题目 id
     */
    private Long questionId;

    public static QuestionSubmit toQuestionSubmit(QuestionSubmitDTO questionSubmitDTO) {
        QuestionSubmit questionSubmit = new QuestionSubmit();
        questionSubmit.setSubmitLanguage(questionSubmitDTO.getLanguage());
        questionSubmit.setSubmitCode(questionSubmitDTO.getCode());
        questionSubmit.setQuestionId(questionSubmitDTO.getQuestionId());
        return questionSubmit;
    }
}
